package com.loto.insurance.mis.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.loto.insurance.mis.web.authority.INSAuthority;
import com.loto.insurance.mis.web.entity.InsCompany;
import com.loto.insurance.mis.web.enumeration.MenuEnum;
import com.loto.insurance.mis.web.enumeration.OrderStatusEnum;
import com.loto.insurance.mis.web.enumeration.InsTypeEnum;
import com.loto.insurance.mis.web.service.InsCompanyService;

@Controller
public class OrderController {

  @Autowired
  InsCompanyService insCompanyService;

  @INSAuthority(authorityMenu = MenuEnum.ORDER_LIST)
  @RequestMapping(value = "/order/list", method = RequestMethod.GET)
  public String orderList(Model model) {
	List<InsCompany> companyList = insCompanyService.getActiveInsCompanyList();

	model.addAttribute("subId", MenuEnum.ORDER_LIST.getIndex());
	model.addAttribute("orderStatusList", OrderStatusEnum.values());
	model.addAttribute("insTypeList", InsTypeEnum.values());
	model.addAttribute("companyList", companyList);
	return "order/order_list";
  }
}
